---
title: "Brother, Can You Spare a Manufacturing Job?  How Voters React to Deindustrialization"
short: "Brother, Can You Spare a Manufacturing Job? "
month: "`r format(Sys.Date(), '%m')`"
year: "`r format(Sys.Date(), '%Y')`"
author:
  - name: Catherine Darin
    firstname: Catherine
    surname: Darin
    email: cdarin@hks.harvard.edu
    affiliation: Harvard University
  - name: Zagreb Mukerjee
    firstname: Zagreb
    surname: Mukerjee
    email: zagrebmukerjee@fas.harvard.edu
    affiliation: Harvard University
acknowledgements: | 
  Code available at https://github.com/zagrebmukerjee/ReplicationPaper
abstract: |
    What led to Donald Trump's surprising 2016 election victory? This paper examines the potential contribution of deindustrialization. We exploit county-level differences in manufacturing density as a source of exogenous variation, using both instrumental-variable regression and covariate balancing methods. Counter-intuitively, we find that counties that gained manufacturing jobs from 2012-2015 are more likely to have swung towards Trump. We believe this is due to an omitted variable - the job loss experienced from 2004 to 2012. Counties that experienced prior deindustrialization were more likely to exhibit increased support for Trump, as well as a slight manufacturing rebound in 2012-2015. Dis-aggregating this result by race shows that the Democratic vote share fell where job losses affected white populations, and rose where job losses affected nonwhites. This suggests a racial component to how voters process economic hardship.
output: rticles::aea_article
header-includes: 
 - \usepackage{graphicx}
 - \usepackage{amsmath}
 - \usepackage{amssymb}
 - \usepackage{placeins}
---

```{r, echo = FALSE, message = FALSE, warning = FALSE}

knitr::opts_chunk$set(echo = FALSE, message = FALSE, warning = FALSE)
library(rticles)
library(tidyverse)
library(stargazer)
library(sandwich)
library(lmtest)
library(knitr)
library(kableExtra)
library(readxl)
library(scales)
library(tigris)
library(dplyr)
library(glmnet)
library(CBPS)
knitr::opts_chunk$set(fig.pos = "!H", out.extra = "")

knitr::knit_hooks$set(plot = function (x, options) {
  float_correct <- function(f, y, opts)  {
    if (is.null(opts$regfloat) || opts$regfloat==FALSE)
      paste0(f(y, opts), "\n\n\\FloatBarrier\n")
    else
      f(y, opts)
  }
  if (!is.null(options$out.width) || !is.null(options$out.height) ||
      !is.null(options$out.extra) || options$fig.align != "default" ||
      !is.null(options$fig.subcap)) {
    if (is.null(options$fig.scap))
      options$fig.scap = NA
    return(float_correct(knitr:::hook_plot_tex, x, options))
  }
  return(float_correct(knitr:::hook_plot_md_base, x, options))
})

```

\section{Introduction} 
\label{Introduction}

This paper analyzes the relationship between deindustrialization, race, and the election of Donald Trump in 2016. Previous analyses have  focused on the effects of racial animus, trade, or the conjunction of the two on  political polarization and election outcomes (\cite{Autor20}; \cite{Che16}; \cite{BR21}). We extend the analysis of \cite{Baccini21}, one of the first papers to examine the political effects of deindustrialization while considering race and localization. 

Deindustrialization - the transition of the U.S. economy away from manufacturing - has led to widespread job loss and created adverse knock-on effects for a wide swath of Americans. Our measure of deindustrialization incorporates job losses due to trade with China and others (see \cite{Acemoglu16}); it also includes job losses due to automation, demand changes, and other factors. The experience of deindustrialization has not been uniform; rather, it has been concentrated in areas of the country that were previously economically reliant on manufacturing. As shown in Figure \ref{ManuMap}, states across the eastern half of America, particularly in the South and Midwest, have experienced the most pronounced manufacturing employment losses. The localized nature of this analysis highlights the uneven and concentrated harms of deindustrialization. 

This paper analyzes the relationship between deindustrialization, race, and the election of Donald Trump in 2016. Previous analysis has  focused on racial animus, trade, or the conjunction of the two on  political polarization and election outcomes (\cite{Autor20}; \cite{Che16}; \cite{BR21}). We extend the analysis of \cite{Baccini21}, one of the first papers to examine the political effects of deindustrialization that while considering race and localization. Deindustrialization - the transition of the U.S. economy away from manufacturing - has led to widespread job loss and created adverse knock-on effects for a wide swath of Americans. Our measure of deindustrialization incorporates job losses due to trade with China and others (see \cite{Acemoglu16}); it also includes job losses due to automation, demand changes, and other factors. The experience of deindustrialization has not been uniform; rather, it has been concentrated in certain areas of the country that were previously economically reliant on manufacturing, as demonstrated in Figure \ref{ManuMap}. The localized nature of this analysis highlights the uneven and concentrated harms of deindustrialization. 

<!-- FIGURE X: MAP OF DEINDUSTRIALIZATION HERE  -->

\FloatBarrier
\begin{figure} 
\caption{Concentration of Deindustrialization (2004-2015) in the eastern United States }
\label{ManuMap}
```{r, message = F, fig.height = 2.5, fig.width = 5.5, fig.align="center" , regfloat=FALSE}
# load map
model_input <- readRDS("../model_5_input.rds")

# state shapefile
county_shape <- counties(
  cb = TRUE,
  resolution = "20m",
  progress_bar = F
) %>%
  shift_geometry() %>%
  mutate(STATEFP = as.numeric(STATEFP),
         COUNTYFP = as.numeric(COUNTYFP))

state_shape <- states(
  cb = TRUE,
  resolution = "20m",
  progress_bar = F
) %>%
  filter(GEOID != "72" & GEOID != "02", GEOID != "15")

# group counties into sextiles
model_input <- model_input %>%
  group_by() %>%
  mutate(ntile_mfg = as.character(ntile(mfgNetChange_total , 6)))

# find cutoffs

sum <- model_input %>%
  group_by(ntile_mfg) %>%
  summarize(min = min(mfgNetChange_total),
            max = max(mfgNetChange_total))

labels = c(
  "1" = "1% or Greater Gain",
  "2" = "0% to 1% Gain",
  "3" = "0% to 1% Loss",
  "4" = "1% to 3% Loss",
  "5" = "3% to 6% Loss",
  "6" = "6% or Greater Loss")


colors <- c("1" = "#778868",
            "2" = "#b5b991",
            "3" = "#f6edbd",
            "4" = "#edbb8a",
            "5" = "#de8a5a",
            "6" = "#ca562c")

#3d5941,#778868,#b5b991,#f6edbd,#edbb8a,#de8a5a,#ca562c
mapping_county <- inner_join(county_shape, model_input,
                      by = c("STATEFP" = "state_fips",
                             "COUNTYFP" = "county_fips"))

ggplot() +
  geom_sf(data = mapping_county, aes(fill = ntile_mfg),
          color = NA, size = .01) +
  scale_fill_manual(values = colors,
                    labels = labels) +
  # add state lines
  geom_sf(data = state_shape, fill = NA, color = "black", size = .1) +
  coord_sf(datum = NA) +
  theme_minimal() +
  # geom_sf_text_repel(aes(label = state), data = mapping_small,
  #                    force = .00001,  seed = 10,
  #                    size = 2.5) +
  theme(  axis.title.x=element_blank(),
          axis.title.y=element_blank(),
          text = element_text(size = 8)) +
  labs(title = "",
       subtitle = "",
       fill = "Net Manufacturing Employment\nLosses from 2004 to 2015") +
  theme(legend.key.size = unit(.4, 'cm'))



```
\begin{figurenotes}
Calculated at the county-level as the net change in manufacturing employment between 2004 and 2015 divided by 2004 total employment.
\end{figurenotes}
\end{figure}
\FloatBarrier


In their central analysis, \cite{Baccini21} analyzed the effect of gross manufacturing job losses from 2012 to 2015 on the change in Democratic vote share in the 2016 presidential election. \cite{Baccini21} find evidence that the experience of deindustrialization was associated with support for Donald Trump, particularly among whites. 

Our analysis extends \cite{Baccini21} in several ways. First, we change focus from a measure of *gross* losses in manufacturing jobs to *net* losses. As discussed in \ref{datasec}, we believe this to be a more accurate measure of deindustrialization. Second, we change the temporal focus. Rather than focusing on manufacturing job loss in 2012-2015, we extend our analysis back to 2004. This is an important change. As shown in Figure \ref{natlPlotTS}, the bulk of U.S. manufacturing job loss took place prior to 2012; in fact, the 2012-2015 period was characterized by a slight rebound in manufacturing jobs. Finally, we augment the instrumental-variable approach with one based on covariate balancing.

Like \cite{Baccini21}, our results suggest that the experience of deindustralization was associated with support for Donald Trump, particularly among whites. However, our results differ from \cite{Baccini21} in regards to the *timing* of the impact of manufacturing job losses on employment. In fact, using our preferred measure of deindustrialization - *net* change in manufacturing employment - we find that counties with manufacturing job *gains* from 2012-2015 tended to swing towards Donald Trump in 2016. Given this counter-intuitive result, we extend the analysis to the 2004-2015 period in order to capture the long-term effects of deindustrialization on a region. Doing so, we find that regions experiencing more manufacturing job losses from 2004-2015 swung towards Donald Trump in 2016, and that this occurred more when those losing jobs were white. We get directionally similar results using our covariate-matching approach - differences in magnitude are an object of further investigation. Relative to \cite{Baccini21}, our results point to the substantive importance of the timing of manufacturing job losses on political outcomes.


<!-- FIGURE X: TIME SERIES OF MANUFACUTRING EMPLOYMENT  -->
\FloatBarrier
\begin{figure}
\caption{Nationwide Change in Manufacturing Employment, 1995-2019}
\label{natlPlotTS}
```{r, message = F, fig.height = 2.5, fig.width = 5.5, fig.align="center", regfloat=FALSE}
# manufacturing layoffs over time

national_ts <- read_xlsx("../National_Data_TS.xlsx")

national_ts <- national_ts %>%
  rename(year = 1,
         net_job_change = 2) %>%
  dplyr::select(year, net_job_change) %>%
  rename(Year = year, `Job Change per Worker` = net_job_change) %>%
  mutate(
    Year = as.numeric(Year),
    `Job Change per Worker` = `Job Change per Worker`*4) %>% group_by()

ggplot(data = national_ts %>% filter(Year >= 1995),
       aes(x = Year, y = `Job Change per Worker`)) +
  ylab("Millions of Jobs") +
  geom_col(fill = "#4287f5") + scale_x_continuous(breaks=seq(1995,2020,5)) +
	scale_y_continuous(labels = label_number(suffix = "", scale = 1e-6)) +
  theme_classic() +
  theme(title = element_text(size = 8, hjust = .5),
        axis.title.x = element_text(size = 8), 
        axis.title.y = element_text(size = 8))


```
\begin{figurenotes}
Annual net change in manufacturing employment in the United States. 
\end{figurenotes}
\end{figure}
\FloatBarrier

\section{Data and Methods} 
\label{datamethods}

\subsection{Data} 
\label{datasec}

Following \cite{Baccini21}, our unit of analysis is the county. This allows us to capture not only the direct effects of deindustrialization on laid-off manufacturing workers, but also possible spillover effects on the greater population within the county. The primary outcome variable is the county's change in Democratic vote share between 2012 and 2016. We obtain data on election outcomes and various covariate terms from the publicly-available replication data provided by \cite{Baccini21}. 

We want to measure the causal relationship between deindustrialization and the change in vote share. As a measure of deindustrialization, we use the loss of manufacturing jobs as a share of the total beginning-of-period employment in each county. Suppose at the beginning of our period there were $2000$ manufacturing workers in a county, and $8000$ non-manufacturing workers. At the end there are only $1500$ manufacturing workers. Using our measure of net manufacturing job losses, this is a loss of $500/10000 = 5\%.$

In this choice we diverge from \cite{Baccini21}, which uses *gross* manufacturing job losses. For example, if a county lost $450$ manufacturing jobs from 2012-2015 and also gained $400$ manufacturing jobs over the same period, this would be $450$ *gross* job losses, but only $50$ *net* job losses. The *gross* measure captures several dynamics unrelated to deindustrialization - for example, seasonal unemployment in a food-manufacturing region, or workers moving between jobs. Thus we believe the *net* job losses over a period are the more accurate measure. Additionally, there is precedent in the literature to use *net* employment changes, as \cite{Autor21} have done. Nevertheless, it can be argued that the non-seasonal or non-structural components of gross job losses are a useful covariate. For instance, basic notions of prospect theory suggest that the loss of a job and subsequent regaining of another identical job may still create substantial discontent. Constructing a better measure of gross job losses is an area for further methodological and substantive research.

Data on job gains and losses are obtained, using an API, from the Census Bureau's Quarterly Workforce Indicators (\cite{QWI}), which contains (among other things) information about employment by industry and county. These statistics are further disaggregated by race and ethnicity. The Census Bureau obtains this data from a combination of sources, such as administrative tax data and the U.S. Census. 

<!--  sources of other data -->

Basic descriptive statistics of job losses and other key covariates can be seen in Table \ref{tab:descTable}.
\FloatBarrier
```{r,  echo=F, regfloat=FALSE}
descriptiveData <-  readRDS("../tableData.rds")

knitr::kable(descriptiveData$table04,
             caption = "Manufacturing Job Changes 2004-2015",label = "descTable",
             booktabs = TRUE, digits = 2, format = 'latex')  %>%
  kable_styling(latex_options = c("hold_position", "scale_down"))

```
\FloatBarrier

\subsection{Methods} 
\label{methodssec}

We conduct two related tests of our hypothesis. Our first test involves an instrumental-variable approach. A regression of change in Democratic vote share on manufacturing job losses risks endogeneity, in case counties with manufacturing job losses were otherwise predisposed to turn towards Trump (a singular candidate, after all). To mitigate these risks, \cite{Baccini21} use a Bartik instrument, which we adapt (see \cite{Bartik91}). This instrument essentially uses the cross-county distribution of manufacturing employment as a source of exogenous variation. 

$$
\begin{aligned}
b_{j,c} &=& \frac{\text{Manufacturing Employment}_{j,c} \text{ at } t_0}{\text{Total Employment}_c \text{ at }t_0}  \\
&&  * \frac{\text{National Manufacturing Job Change}_{j,c} }{\text{Total National Employment at }t_0} \\
\end{aligned}
$$

Using this instrument, we then conduct a two-stage regression. First we estimate manufacturing job loss with the Bartik Instrument and a set of county-level controls; then we use the estimated values of job losses to predict Democratic vote share. In these regressions we control for unemployment, the share of college-educated voters, and the share of male voters. For some estimates, we also control for the white share of the population and service layoffs. We also apply state fixed effects to account for a wide variety of state-level changes from 2012-2016 (such as voter suppression tactics). These controls are similar to those of \cite{Baccini21}.

Our second approach involves attempting to balance the covariates of the deindustrialization treatment. We use the same covariates as are used in controls above, as well as manufacturing as share of the population and total population. We apply the method of Covariate Balancing Propensity Scores, as developed by \cite{Imai14}; this method generates weights to reduce the correlation between covariates and treatment, while addressing several of the issues with propensity score weights. We find significant imbalance in the data - in other words, it is relatively easy to predict the 'treatment' of job loss given the covariates (see Appendix for balance plots). Given covariate-balancing weights, we then conduct a single-stage weighted regression of change in Democratic vote share on manufacturing job loss, using the same controls as above. 

\subsection{Results}

We find that counties experiencing deindustrialization from 2004-2015 are substantially more likely to vote for Trump. Further, we find that this effect is largely attributable to whites. In other words, net white manufacturing job losses decreased Democratic vote share, while net non-white manufacturing job losses increased Democratic vote share. We find the same effect when using covariate balancing, albeit of reduced size. 

The results can be found in Table \ref{regResult04}. The regression coefficient in Model 4, for instance, means that a loss of $10$ white manufacturing jobs per $100$ workers in a county (a relatively extreme value) corresponds to a $3.2$ percentage point loss in Democratic vote share.
\FloatBarrier
```{r,  echo=F, message = F, results = "asis", regfloat=FALSE}

regResultList <- readRDS("../regresults.rds")
matchResultList <- readRDS("../cbpsResults.rds")


rownames(regResultList$secondStageModelNetC04A$coefficients )[rownames(regResultList$secondStageModelNetC04A$coefficients)=="firstStageModelOurs04_2$fitted.values"] <-  "Job Losses"
rownames(regResultList$secondStageModelNetC04$coefficients )[rownames(regResultList$secondStageModelNetC04$coefficients)=="firstStageModelOurs04_3$fitted.values"] <-  "Job Losses"
rownames(regResultList$secondStageModelWNetC04A$coefficients )[rownames(regResultList$secondStageModelWNetC04A$coefficients)=="firstStageModelOurs04_5$fitted.values"] <-  "White Job Losses"
rownames(regResultList$secondStageModelWNetC04$coefficients )[rownames(regResultList$secondStageModelWNetC04$coefficients)=="firstStageModelOurs04_6$fitted.values"] <-  "White Job Losses"

rownames(regResultList$secondStageModelWNetC04A$coefficients
)[rownames(regResultList$secondStageModelWNetC04A$coefficients)=="mfgNetChange_nonwhite"] <-  "Nonwhite Job Losses"
rownames(regResultList$secondStageModelWNetC04$coefficients
)[rownames(regResultList$secondStageModelWNetC04$coefficients)=="mfgNetChange_nonwhite"] <-  "Nonwhite Job Losses"


rownames(regResultList$secondStageModelNetC04A$beta )[rownames(regResultList$secondStageModelNetC04A$beta) =="firstStageModelOurs04_2$fitted.values"] <-  "Job Losses"
rownames(regResultList$secondStageModelNetC04$beta )[rownames(regResultList$secondStageModelNetC04$beta)=="firstStageModelOurs04_3$fitted.values"] <-  "Job Losses"
rownames(regResultList$secondStageModelWNetC04A$beta )[rownames(regResultList$secondStageModelWNetC04A$beta)=="firstStageModelOurs04_5$fitted.values"] <-  "White Job Losses"
rownames(regResultList$secondStageModelWNetC04$beta )[rownames(regResultList$secondStageModelWNetC04$beta)=="firstStageModelOurs04_6$fitted.values"] <-  "White Job Losses"

rownames(regResultList$secondStageModelWNetC04A$beta )[rownames(regResultList$secondStageModelWNetC04A$beta)=="mfgNetChange_nonwhite"] <-  "Nonwhite Job Losses"
rownames(regResultList$secondStageModelWNetC04$beta )[rownames(regResultList$secondStageModelWNetC04$beta)=="mfgNetChange_nonwhite"] <-  "Nonwhite Job Losses"

rownames(matchResultList$secondStageModelOurs04LW_3$coefficients)[rownames(matchResultList$secondStageModelOurs04LW_3$coefficients) == "mfgNetChange_total"] <- "Job Losses"
rownames(matchResultList$secondStageModelOurs04LW_6$coefficients)[rownames(matchResultList$secondStageModelOurs04LW_6$coefficients) == "mfgNetChange_white"] <- "White Job Losses"
rownames(matchResultList$secondStageModelOurs04LW_6$coefficients)[rownames(matchResultList$secondStageModelOurs04LW_6$coefficients) == "mfgNetChange_nonwhite"] <- "Nonwhite Job Losses"


rownames(matchResultList$secondStageModelOurs04LW_3$beta)[rownames(matchResultList$secondStageModelOurs04LW_3$beta) == "mfgNetChange_total"] <- "Job Losses"
rownames(matchResultList$secondStageModelOurs04LW_6$beta)[rownames(matchResultList$secondStageModelOurs04LW_6$beta) == "mfgNetChange_white"] <- "White Job Losses"
rownames(matchResultList$secondStageModelOurs04LW_6$beta)[rownames(matchResultList$secondStageModelOurs04LW_6$beta) == "mfgNetChange_nonwhite"] <- "Nonwhite Job Losses"


names(regResultList$rseNetC04A_2)[1] <- "Job Losses"
names(regResultList$rseNetC04_2)[1] <- "Job Losses"
names(regResultList$rseWNetC04A_2)[1] <- "White Job Losses"
names(regResultList$rseWNetC04_2)[1] <- "White Job Losses"

names(regResultList$rseWNetC04A_2)[names(regResultList$rseWNetC04A_2) == "mfgNetChange_nonwhite"] <- "Nonwhite Job Losses"
names(regResultList$rseWNetC04_2)[names(regResultList$rseWNetC04_2) == "mfgNetChange_nonwhite"] <- "Nonwhite Job Losses"



names(matchResultList$rseOurs04LW3_2)[1] <- "Job Losses"
names(matchResultList$rseOurs04LW6_2)[1] <- "White Job Losses"
names(matchResultList$rseOurs04LW6_2)[names(matchResultList$rseOurs04LW6_2) == "mfgNetChange_nonwhite"] <- "Nonwhite Job Losses"



stargazer(regResultList$secondStageModelNetC04A,
          regResultList$secondStageModelNetC04,
          matchResultList$secondStageModelOurs04LW_3,
          regResultList$secondStageModelWNetC04A,
          regResultList$secondStageModelWNetC04,
          matchResultList$secondStageModelOurs04LW_6,
          se = list(
            regResultList$rseNetC04A_2,
            regResultList$rseNetC04_2,
            matchResultList$rseOurs04LW3_2,
            regResultList$rseWNetC04A_2,
            regResultList$rseWNetC04_2,
            matchResultList$rseOurs04LW6_2
          ),
          title = "Effect of Manufacturing Job Loss from 2004 to 2015",
          dep.var.labels = "Change in Dem. Share, 2016-2012",
          omit.stat = c("rsq","ser"),
          keep = c("Job Losses", "White Job Losses", "Nonwhite Job Losses"),
          add.lines = list(
            c("White Share/Svc Layoffs", "No", "Yes", "Yes", "No", "Yes", "Yes"),
            c("Covariate Balancing", "No", "No", "Yes", "No", "No", "Yes")
          ),
          digits = 2,
          header = F,
          type = "latex",
          label = "regResult04", column.sep.width = "2pt", font.size = "small"
)

```
\FloatBarrier
This coefficient is still somewhat difficult to interpret, and made increasingly so by the winner-take-all system by which U.S. Electoral College votes are allocated. As an alternative perspective, we examined a range of counterfactual scenarios, in which counties manufacturing experienced job losses between the 1st and 99th percentiles across all counties. 

For example, in the map in Figure \ref{counterfactual1} below, we assume that all counties in the US experienced a loss in white manufacturing employment equivalent to the level experienced by a county at the 25th percentile. Here, that level is equivalent to a 0 net loss in white manufacturing jobs between 2004-2015 per 100 workers in 2004 (a relatively low level of job losses). Setting all counties' white manufacturing job losses to 0, we use the point estimates of our regression coefficients from Model 4 in Table \ref{regResult04} to estimate the counterfactual change in Democratic vote share. We find that, had all counties experienced the 25th percentile level in manufacturing job losses, most states would have leaned more Democratic in 2016, and that Michigan and Pennsylvania would have flipped.


\FloatBarrier
\begin{figure} 
\caption{Counterfactual Scenario: Change in Democratic Vote Share Assuming 25th Percentile of Manufacturing Job Losses}
\label{counterfactual1}
```{r, message = F, fig.height = 2.5, fig.width = 5.5, fig.align="center", regfloat=FALSE}

# load map
model_input <- readRDS("../model_5_input.rds")
model_results <- readRDS("../model_5_results.rds")


# load voting data
library(data.table)
voting <- fread("..\\voting data.csv")


# filter model input based on our regression filtering
model_input <- model_input %>%
  filter(is.finite(bartik_leo5_w2),
         is.finite(mfgNetChange_white),
         is.finite(mfgNetChange_nonwhite))

# find the 25th percentile in manufacturing layoffs (our measure) across counties
p25 <- quantile(model_input$mfgNetChange_white, (.25))

# find the predicted democratic vote share
model_input$P_ddem_1 <- model_results$fitted.values


model_input <- model_input %>%
  mutate(
    
    # calculate the counterfactual change in democratic vote share
    # by multiplying our regression coefficient against the difference
    # between observed manufacturing layoffs (our measure) and the
    # 25th percentile of layoffs (nationally)
    
    # counterfactual net change in manufacturing job losses     
    CF_netchange = p25,
    
    # difference between counterfactual and actual net manufacturing job losses 
    CF_d_netchange = CF_netchange - mfgNetChange_white,
    
    # effect size -> coeff on white manufacturing layoffs times by the dif between CF and actual
    CF_ddem_change = CF_d_netchange*model_results$coefficients[1],
    
    # counterfactual predicted dem vote share
    
    P_ddem_2 = P_ddem_1 + CF_ddem_change) %>%
  
  dplyr::select(id, state_fips, state, state_name, county_fips,
                county, year, dem_votes_pct1, ddem_votes_pct1,
                P_ddem_1, mfgNetChange_white, mfgNetChange_total,
                mfgNetChange_nonwhite,
                CF_netchange,
                CF_d_netchange,
                CF_ddem_change,
                P_ddem_2)

# clear voting data
voting <- voting %>%
  dplyr::select(year, state, county_name, county_fips,
         party, candidatevotes) %>%
  filter(party == "DEMOCRAT" | party == "REPUBLICAN") %>%
  group_by(year, county_fips) %>%
  summarize(total_dem_rep_votes = sum(candidatevotes),
         dem_votes = sum(candidatevotes[party == "DEMOCRAT"]),
         rep_votes = sum(candidatevotes[party == "REPUBLICAN"])) %>%
  mutate(dem_vote_share = dem_votes/total_dem_rep_votes)

# prep model input data to be merged to voting data
model_input <- model_input %>% mutate(
  c_fips_long = case_when(
    str_length(as.character(county_fips)) == 1 ~
      paste0("00", as.character(county_fips)),
    str_length(as.character(county_fips)) == 2 ~
      paste0("0", as.character(county_fips)),
    TRUE ~ as.character(county_fips)),
  s_fips_long  = case_when(
    str_length(as.character(state_fips)) == 1 ~
      paste0("0", as.character(state_fips)),
    TRUE ~ as.character(state_fips)),

  fips_long = paste0(s_fips_long, c_fips_long),
  fips_numeric = as.numeric(fips_long))

# join model input to observed voting data
model_input <- left_join(model_input, voting,
                          by = c("fips_numeric" = "county_fips",
                                 "year" = "year"))

# calculate the counterfactual dem votes and rep votes
model_input <- model_input %>%
  mutate(
    CF_dem_votes = dem_votes + CF_ddem_change*total_dem_rep_votes,
    CF_rep_votes = rep_votes - CF_ddem_change*total_dem_rep_votes)

# create mapping categories
order = c(
 # "+2% or greater", 
  #"+1% to +2%",
          "+0.5% to +1%",
          "+0.25% to +0.5%", 
          "0% to +0.25%", 
          "0% to -0.25%")

state_summary <- model_input %>%
  group_by(state) %>%
  summarize(actual_trump_votes = sum(rep_votes),
            actual_dem_votes = sum(dem_votes),
            CF_trump_votes = sum(CF_rep_votes),
            CF_dem_votes = sum(CF_dem_votes)) %>%

  mutate(changed_outcome  =
           ifelse(
             CF_dem_votes > CF_trump_votes &
               actual_trump_votes > actual_dem_votes,
             1, 0),
    actual_trump_vs =
      actual_trump_votes/(actual_trump_votes+ actual_dem_votes),
    CF_trump_vs =
      CF_trump_votes/(CF_trump_votes+CF_dem_votes),
    delta_vs = CF_trump_vs - actual_trump_vs) %>%
  mutate(
    delta_vs_group = case_when(delta_vs < -.02 ~ "+2% or greater",
                         delta_vs < -.01 ~ "+1% to +2%",
                         delta_vs < -.005 ~ "+0.5% to +1%",
                         delta_vs < -.0025 ~ "+0.25% to +0.5%",
                         delta_vs < 0 ~ "0% to +0.25%",
                         delta_vs < .0025 ~ "0% to -0.25%",
                         delta_vs < .005 ~ "-0.25% to -0.5%",
                         delta_vs < .01 ~ "-0.5% to -1%",
                         TRUE ~ "-1% or greater")) %>%
  mutate(delta_vs_group = factor(delta_vs_group, levels = order))


colors =
   c(
    # "+2% or greater" = "#0059ff",
     #"+1% to +2%" = "#4988fc",
     "+0.5% to +1%" = "#86b0fc",
     "+0.25% to +0.5%" = "#b8d1ff",
     "0% to +0.25%" = "#dee9fc",
     "0% to -0.25%" = "#ffeae8")

# state shapefile
state_shape <- states(
  cb = TRUE,
  resolution = "20m",
  progress_bar = F
) %>%
  filter(GEOID != "72") %>%
  shift_geometry()

mapping <- inner_join(state_shape, state_summary,
                      by = c("STUSPS" = "state"))


mapping_small <- mapping #%>% filter(state != "DC")

mapping_small <- mapping_small %>%
  mutate(changed_outcome = ifelse(changed_outcome == 0,
                                  "No",
                                  "Yes"))

#  make map
flipped <- mapping_small %>% filter(changed_outcome == "Yes")
ggplot() +
  geom_sf(data = mapping_small, aes(fill = delta_vs_group), color = "black", size = .1) +
  scale_fill_manual(values = colors) +
  labs(title = "",
       subtitle = "",
       fill = "Change in Democratic Vote Share") +
  geom_sf(data = flipped, fill = NA, 
          aes(color = changed_outcome), 
          size = 1) +
  scale_color_manual(values = "#b32ab5", name = "Flipped Election") +
  labs(color = "Flipped Election") +
  coord_sf(datum = NA) +
  theme_minimal() +
  # geom_sf_text_repel(aes(label = state), data = mapping_small,
  #                    force = .00001,  seed = 10,
  #                    size = 2.5) +
  theme(  axis.title.x=element_blank(),
          axis.title.y=element_blank(),
          legend.key.size = unit(.3, 'cm'))


```
\end{figure}
\FloatBarrier

We also demonstrate uncertainty around our coefficient estimates using a simulation approach. Specifically, for each percentile of white manufacturing job losses, we simulate 1,000 election outcomes by drawing from the distribution around our coefficient point estimate 1,000 times (again, using the results from Model 3 in Table \ref{regResult04}). In Figure \ref{counterfactual2}, we find that, assuming the 24th percentile or lower of white manufacturing job losses, we find that the median estimate in our simulation shows Democratic winning at least 270 electoral college votes. Using the 95\% confidence intervals produced from the simulation exercise, we find that we would be 95\% confident that Democrats would have won the national election had white manufacturing job losses been at the 5th percentile or lower. This result suggest that manufacturing job losses would have had to have been substantially lower and *negative* (e.g., job gains) in order for the national election outcome to have been flipped with 95\% confidence.


\FloatBarrier
\begin{figure} 

\caption{Counterfactual Simulation Results: Democratic Electoral College Votes Assuming White Manufacturing Job Losses Between 1st and 99th Percentile }
\label{counterfactual2}
```{r, message = F, fig.height = 2.5, fig.width = 5.5, fig.align="center", regfloat=FALSE}

# load map
simulation_results <- readRDS("../counterfactual_simu_results.rds")
num_sims <- 1000

summary <- simulation_results %>%
  group_by(ptile) %>%
  arrange(trump_votes_cf) %>%
  summarize(median_result = clinton_votes_cf[row_number() == (num_sims/2)],
            lower = clinton_votes_cf[row_number() == (num_sims/40)],
            upper = clinton_votes_cf[row_number() ==(num_sims- (num_sims/40))])


# plot distribution and each percentile

# first plot CI
ggplot(summary, aes(ptile, median_result)) + 
  geom_point() +
  geom_errorbar(aes(ymin = lower, ymax = upper),
                color = "blue") +
  geom_hline(yintercept = 270, color = "red") +
  theme_bw() +
  ylab("Democratic Electoral College Votes\n") +
  xlab("Assumed Percentile of White Manufacturing Job Losses\n")   +
  theme(axis.title.x = element_text(size = 8), 
        axis.title.y = element_text(size = 8))


```
\begin{figurenotes}
Figure shows a 95\% confidence interval for Democratic Electoral College Votes at Each Percentile of Manufacturing Job Losses. The black dot indicates the median electoral college vote estimate at each percentile. The red line shows the 270 electoral vote threshold.
\end{figurenotes}
\end{figure}
\FloatBarrier


Using the same simulation approach described above, in Figure \ref{counterfactual3} we illustrate the frequency with which Democrats would have won the presidential election (270 votes) given each percentile of white manufacturing job losses. Our simulation results show that, when we assumed 24th percentile or lower of white manufacturing job losses,  Democrats won the presidential election in at least 50 percent of simulations. When we assumed the 17th percentile or lower, Democrats won the presidential election in at least 75 percent of simulations. Taken together, these results suggest that Democrats would have had a significantly higher chance of winning the presidential election had white manufacturing job layoffs been substantially lower.

It is important to note that, in the counterfactual and simulation exercises shown in Figures \ref{counterfactual1}, \ref{counterfactual2}, and \ref{counterfactual3}, we estimate the change in Democratic vote share assuming various levels of white manufacturing job losses *holding all else equal, including non-white manufacturing job losses.* Given that white and non-white manufacturing job losses are weakly-to-moderately correlated across counties (r = .33), this is likely a poor assumption, because, in reality, a decline in white manufacturing job losses would likely correspond to a decline in non-white manufacturing job losses. Given that non-white manufacturing job losses were expected to *increase* Democratic vote share in 2016, this means that our simulation results may be overestimating effect sizes because it does not take into account this second-order impact.

\FloatBarrier
\begin{figure} 
\caption{Counterfactual Simulation Results: Democratic Presidential Win Frequency}
\label{counterfactual3}
```{r, message = F, fig.height = 2.5, fig.width = 5.5, fig.align="center", regfloat=FALSE}

library(dplyr)
library(ggplot2)
summary2 <- simulation_results %>%
  mutate(hil_wins = case_when(clinton_votes_cf > 270 ~ 1,
                              TRUE ~ 0)) %>%
  group_by(ptile) %>%
  summarize(perc_wins =  sum(hil_wins)/n())


ggplot(summary2, aes(ptile, perc_wins)) + 
  geom_col(fill = "#4287f5")  +
  theme_bw() +
  ylab("Frequency of Democratic Presidential Win\nIn 1000 Simulations") +
  xlab("Assumed Percentile of White Manufacturing Job Losses\n") +
  ggtitle("") + theme(text = element_text(size = 8))



```
\end{figure}
\FloatBarrier


More broadly, we would like to acknowledge our focus on white manufacturing job losses over non-white manufacturing job losses. We focus on white manufacturing job losses for two reasons. First, in the United States, manufacturing employment and job losses have historically been predominately white (See Table \ref{tab:descTable}). Second, our regression results (See Table \ref{regResult04}) suggest that white manufacturing job losses have a larger negative effect on Democratic vote share relative to the magnitude of the positive effect from non-white manufacturing job losses. For these reasons, our results suggest that, in aggregate, white manufacturing job losses have had larger effect on political outcomes than non-white manufacturing job losses. However, we would like to highlight that the political consequences from non-white manufacturing job losses is a topic that is under-explored in this paper, and is an important area for future work.


\subsubsection{Timing}

Restricting our analysis to only the 2012-2015 period, while continuing to use the net job loss metric, produces an effect opposite to that of \cite{Baccini21}. The loss of Democratic vote share seems to be associated with a gain in manufacturing jobs, both in general and among whites. We believe this time-restricted analysis suffers from an omitted variable bias. As discussed above, the 2012-2015 period can be broadly characterized as a slight rebound from the manufacturing job losses in the 2008 financial crisis. The counties that experience job losses from 2004-2012 are more likely to have job gains in 2012-2015 (see \ref{fig:vShapePlot1}). An apparent relationship between 2012-2015 job gains and loss of Democratic vote share in fact represents 2004-2012 job losses that may lead to both the later job gains and the loss of vote share. These results can be seen in Table \ref{regResult12}.
\FloatBarrier
```{r,  echo=F, message = F, results = "asis", regfloat=FALSE}

rownames(regResultList$secondStageModelNetCA$coefficients )[rownames(regResultList$secondStageModelNetCA$coefficients)=="firstStageModelOurs_2$fitted.values"] <-  "Manufacturing Layoffs"
rownames(regResultList$secondStageModelNetC$coefficients )[rownames(regResultList$secondStageModelNetC$coefficients)=="firstStageModelOurs_3$fitted.values"] <-  "Manufacturing Layoffs"
rownames(regResultList$secondStageModelWNetCA$coefficients )[rownames(regResultList$secondStageModelWNetCA$coefficients)=="firstStageModelOurs_5$fitted.values"] <-  "White Manufacturing Layoffs"
rownames(regResultList$secondStageModelWNetC$coefficients )[rownames(regResultList$secondStageModelWNetC$coefficients)=="firstStageModelOurs_6$fitted.values"] <-  "White Manufacturing Layoffs"

rownames(regResultList$secondStageModelWNetCA$coefficients 
)[rownames(regResultList$secondStageModelWNetCA$coefficients)=="mfgNetChange_nonwhite"] <-  "Nonwhite Manufacturing Layoffs"
rownames(regResultList$secondStageModelWNetC$coefficients
)[rownames(regResultList$secondStageModelWNetC$coefficients)=="mfgNetChange_nonwhite"] <-  "Nonwhite Manufacturing Layoffs"


rownames(regResultList$secondStageModelNetCA$beta )[rownames(regResultList$secondStageModelNetCA$beta) =="firstStageModelOurs_2$fitted.values"] <-  "Manufacturing Layoffs"
rownames(regResultList$secondStageModelNetC$beta )[rownames(regResultList$secondStageModelNetC$beta)=="firstStageModelOurs_3$fitted.values"] <-  "Manufacturing Layoffs"
rownames(regResultList$secondStageModelWNetCA$beta )[rownames(regResultList$secondStageModelWNetCA$beta)=="firstStageModelOurs_5$fitted.values"] <-  "White Manufacturing Layoffs"
rownames(regResultList$secondStageModelWNetC$beta )[rownames(regResultList$secondStageModelWNetC$beta)=="firstStageModelOurs_6$fitted.values"] <-  "White Manufacturing Layoffs"

rownames(regResultList$secondStageModelWNetCA$beta )[rownames(regResultList$secondStageModelWNetCA$beta)=="mfgNetChange_nonwhite"] <-  "Nonwhite Manufacturing Layoffs"
rownames(regResultList$secondStageModelWNetC$beta )[rownames(regResultList$secondStageModelWNetC$beta)=="mfgNetChange_nonwhite"] <-  "Nonwhite Manufacturing Layoffs"



names(regResultList$rseNetCA_2)[1] <- "Manufacturing Layoffs"
names(regResultList$rseNetC_2)[1] <- "Manufacturing Layoffs"
names(regResultList$rseWNetCA_2)[1] <- "White Manufacturing Layoffs"
names(regResultList$rseWNetC_2)[1] <- "White Manufacturing Layoffs"

names(regResultList$rseWNetCA_2)[names(regResultList$rseWNetCA_2) == "mfgNetChange_nonwhite"] <- "Nonwhite Manufacturing Layoffs"
names(regResultList$rseWNetC_2)[names(regResultList$rseWNetC_2) == "mfgNetChange_nonwhite"] <- "Nonwhite Manufacturing Layoffs"




stargazer(regResultList$secondStageModelNetCA,
          regResultList$secondStageModelNetC,
          regResultList$secondStageModelWNetCA,
          regResultList$secondStageModelWNetC,
          se = list(
            regResultList$rseNetCA_2,
            regResultList$rseNetC_2,
            regResultList$rseWNetCA_2,
            regResultList$rseWNetC_2
          ),
          title = "Effect of Manufacturing Job Loss from 2004 to 2015",
          dep.var.labels = "Change in Dem. Share, 2016-2012",
          omit.stat = c("rsq","ser"),
          keep = c("Manufacturing Layoffs", "White Manufacturing Layoffs", "Nonwhite Manufacturing Layoffs"),
          add.lines = list(
            c("White Share/Svc Layoffs Control", "No", "Yes", "No", "Yes")
          ),
          digits = 2,
          header = F,
          type = "latex",
          label = "regResult12"
)

```
\FloatBarrier
This result suggests an important temporal dimension to the political effects of deindustrialization - job losses in 2004-2012 make their effects felt in 2016. In some ways, this result is more plausible than if the 2012-2015 job losses were a significant covariate of voting. The effects of job loss may take some time to be felt, at both individual and community levels (see \cite{Mckee09}, \cite{Foote19}). The mechanisms of this relationship make a good topic for subsequent research. 


\subsection{Conclusion}

As much research has noted, the national and global implications of American  deindustrialization are only beginning to be felt - from the 2016 election to isolationism to the opioid epidemic. Previous analyses have often focused on choosing between explanations grounded in racial issues or political-economic evolutions (ex: \cite{Green19}, \cite{Reny19}). We are joining a growing body of scholars searching for explanations at the intersection of the two. We believe that deindustrialization is fundamentally connected to particular places, and so the localized approach adopted by \cite{Baccini21} offers a great deal of promise. Further research might explore further ways in which geography has influenced the rightward turn in the U.S., for example through the use of techniques of spatial econometrics or the careful use of ethnography. 

While our study is oriented towards history, deindustrialization is in no way confined to the past. The trajectory of American manufacturing employment is far from certain, with continued competition from abroad and the perennial threat of automation. We believe the case of the U.S. also offers insight that is applicable to the phenomenon of 'premature deindustrialization' in the developing world, and the concurrent growth of populist parties in Hungary, Brazil, India and elsewhere (\cite{Rodrik15}, \cite{Castillo16}).



\nocite{Stargazer}
\bibliographystyle{aea}
\bibliography{references}


\appendix

\section{Appendix}

<!-- FIGURE X: V SHAPED RECOVERY  -->

\begin{figure} 
\caption{V-Shaped Recovery in Manufacturing Job Losses: Manufacturing Job Losses (2004-2011) by (2004-2011) Decile Groupings}
\label{fig:vShapePlot1}
```{r, message = F, fig.height = 2.5, fig.width = 5.5, fig.align="center"}

ntile_summary <- readRDS("../v_shaped_recovery.rds")

ntile_summary <- ntile_summary %>% mutate(n_tile_04_11 = as.numeric(n_tile_04_11))
# plot 2004-2011 manu layoffs by deciles
ggplot(data = ntile_summary,
       aes(x = n_tile_04_11, y = mean_04_11)) +
  theme_minimal() +
  ylab("Mean Manufacturing Job Losses (04-11)") +
  xlab("Decile of Manufacturing Job Losses (04-11)")+
  ggtitle("") +
  geom_col(fill = "#4287f5") +
  scale_x_continuous(breaks=seq(1,10,1))  + theme(text = element_text(size = 8))


```
\begin{figurenotes}
Deciles are determined based on our preferred measure of deindustrialization: total net manufacturing job losses from 2004-2015 divided by total 2004 employment. Counties in decile 1 had the lowest manufacturing job losses (i.e., an increase in manufacturing employment) while counties in decile 10 had the highest manufacturing job losses. The y-axis shows the mean measure of manufacturing job losses (2004-2015) per 2004 worker across counties in each decile group.
\end{figurenotes}
\end{figure}


\begin{figure} 
\caption{V-Shaped Recovery in Manufacturing Job Losses: Manufacturing Job Losses (2012-2015) by 2004-2011 Decile Groupings}
\label{vShapePlot2}
```{r, message = F, fig.height = 2.5, fig.width = 5.5, fig.align="center"}

# plot 2012-2015 manu layoffs by deciles
ggplot(data = ntile_summary,
       aes(x = n_tile_04_11, y = mean_12_15)) +
  theme_minimal() +
  ylab("Mean Manufacturing Job Losses (12-15)") +
  xlab("Decile of Manufacturing Job Losses (04-11)")+
  ggtitle("") +
  geom_col(fill = "#4287f5") +
  scale_x_continuous(breaks=seq(1,10,1)) + theme(text = element_text(size = 8))


```

\begin{figurenotes}
Deciles are determined based on our preferred measure of deindustrialization: total net manufacturing job losses from 2004-2015 divided by total 2004 employment. The y-axis shows the mean measure of manufacturing job losses (2012-2015) per 2011 worker across counties in each decile group. The chart shows that counties with the most manufacturing job losses from 2004-2011 (i.e. in the highest deciles) experienced the most manufacturing *gains* from 2012-2015.
\end{figurenotes}
\end{figure}




\begin{figure} 
\caption{Covariate Balance in Aggregate}
\label{balPlot}
```{r, message = F, fig.width = 5.5, fig.align="center"}
cbpsObjs <- readRDS("../cbpsObjects.rds")
plot(cbpsObjs$fit04)

```

\end{figure}



\begin{figure} 
\caption{Covariate Balance in Whites}
\label{balPlotWhite}
```{r, message = F, fig.width = 5.5, fig.align="center"}
plot(cbpsObjs$fit04_white)

```

\end{figure}